#pragma once

#include <AVUIMatrix3D.h>

namespace AVUI {

class Matrix3DStack : public Object
{
public:

#pragma region Internal Methods

    Matrix3DStack() { };

    void Clear() { m_stack.Clear(); }
    Matrix3D Pop()
    {
        Matrix3D top = get_Top();
        m_stack.RemoveAt(m_stack.get_Count() - 1);
        return top;
    }

    void Push(Matrix3D matrix)
    {
        if (m_stack.get_Count() > 0)
        {
            matrix.Append(get_Top());
        }
        m_stack.AddItem(matrix);
    }
    void PushWithoutAccumulating(const Matrix3D& matrix)
    {
        m_stack.AddItem(matrix);
    }

#pragma endregion Internal Methods

#pragma region Internal Properties

    int get_Count() { return m_stack.get_Count(); }
    bool get_IsEmpty() { return m_stack.get_Count() == 0; }
    Matrix3D get_Top() { return m_stack[m_stack.get_Count() - 1]; }

#pragma endregion Internal Properties

private:

#pragma region Private Fields

    ItemStructList<Matrix3D> m_stack;

#pragma endregion Private Fields


};


}; // namespace AVUI

